package org.jgs1904.publisherandlistener.listener;

import org.jgs1904.publisherandlistener.event.MyTestEvent;
import org.jgs1904.publisherandlistener.event.MyTestEvent2;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 自定义事件以及监听
 *
 * @author: 默苍璃
 * @date: 2023-11-03 18:57
 */
@Component
public class MyAnnotationListener {

    @EventListener
    public void listener1(MyTestEvent event) {
        System.out.println("注解监听器1:" + event.getMsg());
    }


    @EventListener
    public void listener2(MyTestEvent2 event) {
        System.out.println("注解监听器2:" + event.getMsg());
    }


}

